﻿using System;
using System.Linq;
using System.Data.Sql;
public partial class Masterpage_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void btnGui_Click(object sender, EventArgs e)
    {
        LinQ_RaoVatDataContext linQ = new LinQ_RaoVatDataContext();

        CHI_TIET_NHAN_TIN_RAO_VAT ct = new CHI_TIET_NHAN_TIN_RAO_VAT();

        ct.Email = TextBox1.Text;
        ct.MaDanhMucCon = int.Parse(dropDanhMucCon.SelectedValue);
        ct.Deleted = false;

        linQ.CHI_TIET_NHAN_TIN_RAO_VATs.InsertOnSubmit(ct);
        linQ.SubmitChanges();

        Response.Redirect(@"~\ThongBao.aspx?ThongBao?Bạn đã đăng ký nhận email thành công");
    }
}
